import { AdManager } from "../ads/AdManager";
import { Tools } from "../common/Tools";
import { UIManager } from "../manager/UIManager";

const { ccclass, property } = cc._decorator;

@ccclass
export default class agreeUI extends cc.Component {

    @property(cc.Node)
    agree: cc.Node = null;

    @property(cc.Node)
    notAgree: cc.Node = null;


    onLoad() {

    }

    start() {
        this.agree.on("click", () => {
            UIManager.ins.close();
            AdManager.showPrivacyUI();
            Tools.setStorage("isAgree", 1);
        });

        this.notAgree.on("click", () => {
            UIManager.ins.close();
            Tools.setStorage("isAgree", 0);
            if(AdManager){
                console.log("AdManager",AdManager.releaseType);
            }
            AdManager.exit();
        });
    }
}
